package com.topisv.tms.repository;

import java.util.Date;
import java.util.List;

import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.repository.PagingAndSortingRepository;

import com.topisv.tms.entity.BackupTask;

public interface BackupTaskDao extends PagingAndSortingRepository<BackupTask, Long>,
		JpaSpecificationExecutor<BackupTask> {
	
	/**
	 * 根据备货批次编号查询
	 * @param batchTaskCode
	 * @return
	 */
	List<BackupTask> findByBatchTaskCode(String batchTaskCode);
	
	List<BackupTask> findByCreateDateBetween(Date startDate,Date endDate);

	/**
	 * 根据备货任务编号查询
	 * @param backupTaskCode
	 * @return
	 */
	BackupTask findByBackupTaskCode(String backupTaskCode);
	
	/**
	 * 根据备货任务编号与备货批次编号查询
	 * @param backupTaskCode 货任务编号
	 * @param batchTaskCode 备货批次编号查询
	 * @return
	 */
	BackupTask findByBackupTaskCodeAndBatchTaskCode(String backupTaskCode,String batchTaskCode);
	
	/**
	 * 根据出库批次编号与备货批次编号查询
	 * @param BatchCode 出库批次编号
	 * @param batchTaskCode 备货批次编号
	 * @return
	 */
	BackupTask findByBatchCodeAndBatchTaskCode(String batchCode,String batchTaskCode);
	
	/**
	 * 根据出库批次编号查询
	 * @param batchCode
	 * @return
	 */
	 List<BackupTask> findByBatchCode(String batchCode);
	
	List<BackupTask> findByStatus(String status);
	
	List<BackupTask> findByStatusAndJobuuid(String status,String jobuuid);
	
	List<BackupTask> findByStatusAndCustomerCode(String status,String customerCode);
	
    List<BackupTask> findByPickStatus(String pick);
	
	List<BackupTask> findByPickStatusAndJobuuid(String pickStatus,String jobuuid);
}
